﻿using System.Collections;
using System.Collections.Generic;
using LitJson;
using UnityEngine;
/// <summary>
/// 该请求组件仅用于接收信息
/// </summary>
public class ReceiveMsgRequest : BaseRequest
{
	private ChatPanel _chatPanel;
	
	
	protected override void Awake()
	{
		_controllerType = ControllerType.CHAT;
		_methodType = MethodType.RECEIVE_MSG;	
		base.Awake();
	}

	

	// Use this for initialization
	void Start () {
		//组件初始化
		_chatPanel = this.gameObject.GetComponent<ChatPanel>();
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	public override void OnResponse(string data)
	{
		JsonData respJsonData = JsonMapper.ToObject(data);
		//交给ChatPanel处理
		_chatPanel.HandleReceiveMsgResponse(respJsonData);
	}
}
